package com.chencl.cipher.controller;

import com.chencl.cipher.annotation.Decrypt;
import com.chencl.cipher.annotation.Encrypt;
import com.chencl.cipher.config.log.OperationLogDetail;
import com.chencl.cipher.config.log.OperationType;
import com.chencl.cipher.config.log.OperationUnit;
import com.chencl.cipher.dto.RequestBodyDTO;
import com.chencl.cipher.dto.ResponseBodyDTO;
import com.chencl.cipher.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @program: rsa-aes-cipher-spring-boot
 * @description:
 * @author: jiangshengli
 * @create: 2022-03-18 14:27
 */
@Slf4j
@RestController
@RequestMapping("/userInfo")
@Validated
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     * 获取用户信息列表
     * @param data
     * @return
     */
    @Encrypt
    @Decrypt
    @PostMapping(value = "/getUserinfoList")
    public ResponseBodyDTO getUserinfoList(@RequestBody RequestBodyDTO data){
        return ResponseBodyDTO.buildSuccess(userInfoService.getUserinfoList());
    }
}
